
#delimit;
set more off;


cd "C:\....\Replication files";
	
use "ENMI - replication.dta", clear;

#delimit;
set more off;


#delimit;
xttobit pvote c.ensh_mi##i.inc_cab_l    pvote_l
		, ul(100) ll(0);
		
		estimates store tobit_enmi_simple;	

#delimit;
		set more off;
xttobit pvote
	c.ensh_mi#i.inc_cab_l c.GDPgrowth#i.inc_cab_l pvote_l
	c.moderate#i.inc_cab_l 1.nparty
		 majelect federal directpres 
		
  if inc_cab_l==1 , ul(100) ll(0)  ;
estimates store tobit_enmi_incumbentsonly;	

#delimit;
		set more off;
xttobit pvote
	c.ensh_mi c.GDPgrowth pvote_l
	c.moderate 1.nparty
		 majelect federal directpres 
		
  if inc_cab_l==0 , ul(100) ll(0)  ;
  /* Won't converge when  L1.1.coalgov L1.1.prime_minister are included*/
		
estimates store tobit_enmi_oppositiononly;			

		set more off;
xttobit pvote
c.ensh_mi##i.inc_cab_l  c.GDPgrowth##i.inc_cab_l pvote_l
	c.moderate##i.inc_cab_l 1.nparty
		 majelect federal directpres 
		, ul(100) ll(0)  ;
estimates store tobit_enmi_full;

		
#delimit;
 esttab tobit_enmi_oppositiononly tobit_enmi_incumbentsonly tobit_enmi_full 
 using "figures\TableA8 - Tobit.rtf", replace 
		b (%10.3f) se scalars("aic AIC" "bic BIC" "chi2 \u0935?{\super 2}" "ll Log-Likelihood" )
		obslast star(+ 0.10 * 0.05 ** 0.01 *** 0.001)
		label mtitles ("Only Opposition"  "Only Incumbents"   "Full") nogaps
		title (\label{})
order(ensh_mi 
1.inc_cab_l#c.ensh_mi 
moderate 
1.inc_cab_l#c.moderate
GDPgrowth
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l 
  1.nparty majelect federal 
directpres pvote_l _cons ) 

keep(ensh_mi 1.inc_cab_l 
1.inc_cab_l#c.ensh_mi GDPgrowth 
1.inc_cab_l#c.GDPgrowth 1.inc_cab_l#c.moderate

moderate 1.nparty majelect federal directpres 
pvote_l _cons )  

 coeflabels(
ensh_mi "ENMI" 
1.inc_cab_l "Incumbent"
1.inc_cab_l#c.ensh_mi "Incumbent X ENMI"
GDPgrowth "GDP Growth Rate" 
1.inc_cab_l#c.GDPgrowth "Incumbent X GDP Growth Rate"
1.inc_cab_l#c.moderate "Incumbent X Moderated Position"
moderate "Moderated Position"
1.nparty "Niche Party"
majelect "Majoritarian Election"
federal "Federal"
directpres "President"
pvote_l "% Vote{\sub t-1}"
_cons "Constant")
addnotes("Note: Tobit model. The Dependent variable is percentage vote for the party.");

